home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Development Tools & Languages / DTSCPlusLibrary / Sources / SpinCursorTest.cp < prev    next >
Encoding:
Text File  |  1993-01-14  |  1.6 KB  |  59 lines  |  [TEXT/MPS ]

  1. /* _________________________________________________________________________________________________________ //
  2.   Copyright © 1992-93 Apple Computer, Inc. All rights reserved.
  3.   Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
  4.   Programmer: Kent Sandvik
  5.   Date: 12/14/92
  6.   Revision comments are at the end of this file.
  7.   ---
  8.   TSpinCursor is a simple cursor spinning class.
  9.   SpinCursorTest.cp contains the TSpinCursor test functions.
  10.   _________________________________________________________________________________________________________ */
  11.  
  12. #include "SpinCursor.h"
  13.  
  14. // This program will sping 20 times forwards and 20 time backwards.
  15. // Don't forget to include the SpinCursor.r resources when you test
  16. // the program.
  17.  
  18. const long kSpins = 20;                            // # spins
  19. const short kWatchID = 6500;                    // acur resource ID
  20. const short kDelayTime = 20;                    // delay between spins
  21.  
  22. void main(void)
  23. {
  24.     cout << "Start of TSpinCursor test…\n";
  25.  
  26.     //    Create TSpinCursor object.
  27.     TSpinCursor mySpin(kWatchID);
  28.  
  29.     //    Spin forwards.
  30.     cout << "First forwards…\n";
  31.     for (long ticking = 0; ticking < kSpins; ticking++)
  32.     {
  33.         ::Delay(kDelayTime, NULL);
  34.         mySpin.Spin();
  35.     }
  36.  
  37.     // Change directions.
  38.     mySpin.SetSpinDirection(TSpinCursor::kBackwards);
  39.  
  40.     //    Spin backwards.
  41.     cout << "Then backwards…\n";
  42.     for (ticking = 0; ticking < kSpins; ticking++)
  43.     {
  44.         ::Delay(kDelayTime, NULL);
  45.         mySpin.Spin();
  46.     }
  47.  
  48.     cout << "End of the TSpinCursor test!\n";
  49. }
  50.  
  51. // _________________________________________________________________________________________________________ //
  52.  
  53.  
  54. /*    Change History (most recent last):
  55.   No        Init.    Date        Comment
  56.   1            khs        12/14/92    New file
  57.   2            khs        1/3/93        Cleanup
  58. */
  59.